/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: #f5f5f5;
    color: #333;
    overflow: hidden;
}

/* 应用容器 */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* 顶部标题栏 */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sidebar-toggle {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.sidebar-toggle:hover {
    background: rgba(255,255,255,0.3);
}

.app-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.version {
    background: rgba(255,255,255,0.2);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
}

/* 主体区域 */
.app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 左侧导航栏 */
.sidebar {
    width: 280px;
    background: #2c3e50;
    color: white;
    overflow-y: auto;
    transition: transform 0.3s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.nav-menu {
    padding: 20px 0;
}

.nav-section {
    margin-bottom: 30px;
}

.nav-section h3 {
    color: #bdc3c7;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 20px 10px;
    border-bottom: 1px solid #34495e;
    margin-bottom: 15px;
}

.nav-list {
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-item:hover:not(.disabled) {
    background: #34495e;
    border-left-color: #3498db;
}

.nav-item.active {
    background: #34495e;
    border-left-color: #e74c3c;
    color: #ecf0f1;
}

.nav-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-item .icon {
    font-size: 18px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.nav-item span {
    font-size: 14px;
    font-weight: 500;
}

/* 右侧主内容区 */
.main-content {
    flex: 1;
    background: white;
    overflow-y: auto;
    transition: margin-left 0.3s ease;
}

.sidebar.hidden + .main-content {
    margin-left: 0;
}

/* 工具面板 */
.tool-panel {
    display: none;
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.tool-panel.active {
    display: block;
}

.tool-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.tool-header h2 {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
}

.tool-header p {
    color: #7f8c8d;
    font-size: 16px;
}

/* 区域样式 */
.section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    border: 1px solid #ecf0f1;
}

.section h3 {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #7f8c8d;
    font-size: 12px;
}

/* 文件输入组 */
.file-input-group {
    display: flex;
    gap: 10px;
}

.file-input-group input {
    flex: 1;
}

.file-input-group button {
    padding: 12px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
    white-space: nowrap;
}

.file-input-group button:hover {
    background: #2980b9;
}

/* 复选框和单选框组 */
.checkbox-group,
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.checkbox-group label,
.radio-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
    margin-bottom: 0;
}

.checkbox-group input,
.radio-group input {
    width: auto;
    margin-right: 8px;
}

/* 按钮样式 */
.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #229954;
    transform: translateY(-2px);
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #e67e22;
    transform: translateY(-2px);
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #c0392b;
    transform: translateY(-2px);
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover:not(:disabled) {
    background: #138496;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #7f8c8d;
    transform: translateY(-2px);
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-weight: 600;
}

.progress-details {
    display: flex;
    gap: 20px;
    font-size: 14px;
}

.progress-details > div {
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #3498db;
}

/* 日志容器 */
.log-container {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 20px;
    border-radius: 8px;
    height: 300px;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.5;
}

.log-item {
    margin-bottom: 5px;
    padding: 2px 0;
}

.log-item.log-success {
    color: #2ecc71;
}

.log-item.log-error {
    color: #e74c3c;
}

.log-item.log-warning {
    color: #f39c12;
}

.log-item.log-info {
    color: #3498db;
}

/* 结果容器 */
.result-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    min-height: 100px;
}

/* 信息框 */
.info-box {
    background: #e8f4fd;
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 20px;
}

.info-box h4 {
    color: #0c5460;
    margin-bottom: 15px;
}

.info-box ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.info-box li {
    margin-bottom: 8px;
    color: #0c5460;
}

.info-box p {
    color: #0c5460;
    margin: 0;
}

/* 工作表选择 */
.sheet-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 10px;
}

.sheet-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
    font-weight: normal;
}

.sheet-item input {
    margin-right: 10px;
    width: auto;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 250px;
    }
    
    .tool-panel {
        padding: 20px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .progress-details {
        flex-direction: column;
        gap: 10px;
    }
}

/* CSV坐标选择样式 */
#csvCoordinateSection {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    background: #f9f9f9;
    margin-top: 10px;
}

#csvCoordinateSection h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 600;
}

.coordinate-selection {
    display: grid;
    gap: 12px;
}

.coordinate-selection .form-group {
    margin-bottom: 0;
}

.coordinate-selection label {
    font-size: 13px;
    color: #555;
    margin-bottom: 5px;
    display: block;
}

.coordinate-selection select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background: white;
}

.coordinate-selection select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

#previewCsvBtn {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.3s;
}

#previewCsvBtn:hover:not(:disabled) {
    background: #218838;
}

#previewCsvBtn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* 隐藏元素样式 */
.hidden {
    display: none !important;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}